#pragma once
#include <uv.h>
#ifdef WIN32
#define DllExport
#else
#define DllExport 
#endif // WIN32
class DllExport loop_controller
{
public:
	static loop_controller& get_instance();
	~loop_controller();
	uv_loop_t* get_loop(){return _loop;}
	void start_run();
	void stop_run();	
	void on_stop_loop();
private:
	loop_controller();
private:
	uv_loop_t* _loop=nullptr;
	bool _brun=false;
	uv_async_t _uv_stop_async;
};
#define g_loop_contor loop_controller::get_instance()
#define g_loop g_loop_contor.get_loop()


